<%@ page contentType="text/html;charset=GBK" %>
<%@ page import="java.util.*" %>
<%@ page import="com.ionglobal.lib.*" %>
<%@ page import="com.ionglobal.misc.*" %>
<%@ page import="com.ionglobal.db.*" %>
<%@ page import="com.ionglobal.project.*" %>

<%@ include file="../init_include.jsp" %>
<%@ include file="../checkPrivileges.jsp" %>
<%
	int catid=Request.getInt("catid");
	int pageid=Request.getInt("pageid",1);
	int pagerows=Request.getInt("pagerows",Page.getPageRows());
  String ordermode=Request.getString("ordermode","desc");  
  String orderfield=Request.getString("orderfield","ggs_OtherData.iId");
  String whereClause=Request.getString("whereClause","");
	int totalpages=0;
	int totalrows=0;
	OtherDataApp newOtherDataApp = new OtherDataApp();
	newOtherDataApp.setWhereClause(whereClause);
	totalrows=newOtherDataApp.getOtherDataNum(dbi);
	totalpages = (int)Math.ceil((double)totalrows/pagerows);
	if(pageid>totalpages)
		pageid=totalpages;
	if(pageid<=1)
		pageid=1;
%>	
<html>
<head>
<title>ggs_OtherData</title>
<meta http-equiv="Content-Type" content="text/html; charset=<%=Language.getHTMLLanguageStr()%>">
<link rel="stylesheet" href="<%=Language.getCSSFile(session)%>" type="text/css">
<SCRIPT language=JavaScript1.2 src="../script/Ion_Show.js"></SCRIPT>
<script language="javascript">
<!--

	function Ion_Add() {
		addIon('vmsSelectFrame.jsp','OtherData_edit.jsp');
	}	

	function Ion_Del() {
		deleteIon('vmsSelectFrame.jsp','OtherData_delete.jsp','ggs_OtherData');		
	}	

	function Ion_Edit() {
		editIon('vmsSelectFrame.jsp','OtherData_edit.jsp','ggs_OtherData');
	}		

	function Ion_View() {
		editIon('vmsSelectFrame.jsp','OtherData_view.jsp','ggs_OtherData');
	}		
	
	function checkForm() {
	}
-->
</script>
</head>

<body bgColor=#d6d3ce leftMargin=0 
style="BORDER-BOTTOM: 0px outset; BORDER-LEFT: 0px outset; BORDER-RIGHT: 0px outset; BORDER-TOP: 0px outset" 
topMargin=0>

<FORM name="formIon" method="post" action="OtherData_list.jsp" onsubmit="return checkForm();">
<table width="100%" border="0" cellspacing="1" cellpadding="2">
  <tr>
    <td class="nagivation" colspan="2"><%=Language.getNameByCode("sys.CurrentPos","Current Position")%>:
    <% 
    Vector vcpath=Category.getLadder(session,"tree",catid);
		out.print(Category.getFullPath(vcpath));
		%>
		</td>
  </tr>
	<tr>
 	 <td align="left"><%=Language.getNameByCode("sys.list"," List")%><%=PageStr.getPageHead(totalrows,pageid,pagerows,totalpages)%>
 	 </td>
 	 <td align=right>
   	<%=PageStr.PageForm(pageid,totalpages)%><input type="submit" name="Submit" value="go" style="width:0">
   </td>
  </tr>
</table>

	<TABLE border=0 cellPadding=0 cellSpacing=1 height="100%" width="100%">
		<input type="hidden" name="catid" value="<%=catid%>">
		<input type="hidden" name="id" value="<%=catid%>">
		<INPUT name="objid" type="hidden">
		<INPUT name="objtext" type="hidden">
		<INPUT name="objflag" type="hidden">
		<INPUT name="actionurl" type="hidden">
		<input type="hidden" name="orderfield" value="<%=orderfield%>">
		<input type="hidden" name="ordermode" value="<%=ordermode%>">
		<input type="hidden" name="whereClause" value="<%=whereClause%>">
  	<TR>
    <TD>
    <%
    Table table=new Table();
    table.setSortMode(ordermode);
    table.setSortField(orderfield);
    table.setSelectionMode("multiple");
    table.addColumn("no","iId",0,"center","left","number");
		table.addColumn("iId","iId",50,"center","right","number");
		table.addColumn("sDataNo","sDataNo",120,"center","left","text");
		table.addColumn("sEngName","sEngName",80,"center","left","text");
		table.addColumn("sChnName","sChnName",80,"center","left","text");
		table.addColumn("sCategory","sCategory",40,"center","left","text");
		table.addColumn("sRemark","sRemark",80,"center","left","text");
		table.addColumn("sFileName","sFileName",80,"center","left","text");
		table.addColumn("sCrUser","sCrUser",40,"center","left","text");
		table.addColumn("dCrDate","dCrDate",92,"center","left","text");

    ArrayList rowsList=new ArrayList();
    try {
    	ArrayList ar=newOtherDataApp.getOtherDataList(dbi,pageid,pagerows,orderfield+" "+ordermode);
    	String rowData="";
    	for(int i=0;i<ar.size();i++) {
    		OtherData newOtherData=(OtherData)ar.get(i);
    		rowData=newOtherData.getId()+"|"+newOtherData.getId()+"|"+newOtherData.getDataNo()+"|"+newOtherData.getEngName()+"|"+newOtherData.getChnName()+"|"+newOtherData.getCategory()+"|"+newOtherData.getRemark()+"|"+newOtherData.getFileName()+"|"+newOtherData.getCrUser()+"|"+newOtherData.getCrDate();
	    	rowsList.add(rowData);
    	}
    } catch(Exception E) {
    }
    ArrayList menuList=new ArrayList();
    TableMenu tm=new TableMenu(Language.getNameByCode("sys.Edit","Edit Selected ")+"ggs_OtherData","javascript:Ion_Edit();",false);
    menuList.add(tm);
    tm=new TableMenu(Language.getNameByCode("sys.Add","Add New ")+"ggs_OtherData","javascript:Ion_Add();",true);
    menuList.add(tm);    
    tm=new TableMenu(Language.getNameByCode("sys.Head.Refresh","Refresh"),"javascript:self.location.reload();",true);
    menuList.add(tm);
    tm=new TableMenu(Language.getNameByCode("sys.Delete","Delete Selected ")+"ggs_OtherData","javascript:Ion_Del();",false);
    menuList.add(tm);
    table.setTableMenu(menuList);
    table.setRowsList(rowsList);
    TableDB tdb=new TableDB();
    out.print(tdb.draw(table));
    %>
	  </TD>
 	</TR>
	</TABLE>
</FORM>
</body>
</html>
<%@ include file="../init_free.jsp" %>
